// src/api/income.js
import request from '@/utils/request';

/**
 * 获取月度收入数据
 */
export function getMonthlyIncome() {
    return request({
        url: '/income/monthly',
        method: 'get'
    });
}

/**
 * 获取年度收入统计
 * @param {Number} year - 年份
 */
export function getYearlyIncomeStats(year) {
    return request({
        url: '/income/yearly-stats',
        method: 'get',
        params: { year }
    });
}

/**
 * 获取收入明细
 * @param {String} status - 账单状态
 * @param {Number} pageNum - 页码
 * @param {Number} pageSize - 每页大小
 */
export function getIncomeDetails(status, pageNum, pageSize) {
    return request({
        url: '/income/details',
        method: 'get',
        params: { status, pageNum, pageSize }
    });
}

/**
 * 获取收入汇总信息
 */
export function getIncomeSummary() {
    return request({
        url: '/income/summary',
        method: 'get'
    });
}

/**
 * 获取最近收入记录
 * @param {Number} limit - 限制数量
 */
export function getRecentIncomeRecords(limit) {
    return request({
        url: '/income/recent',
        method: 'get',
        params: { limit }
    });
}

/**
 * 导出收入数据
 */
export function exportIncomeData() {
    return request({
        url: '/income/export',
        method: 'get',
        responseType: 'blob'
    });
}